import java.util.HashMap;

/**
 * @projectName: com.xiayuanxing.designPattern
 * @className: SubExpression
 * @author: xiayuanxing
 * @description: TODO
 * @date: 2022/1/17 16:12
 * @version: 1.0
 */
public class SubExpression extends SymbolExpression{

    public SubExpression(Expression left, Expression right) {
        super(left, right);
    }

    //求出left和right表达式相减后的结果
    public int interpreter(HashMap<String, Integer> var) {
        return super.left.interprete(var) - super.right.interprete(var);
    }
}
